package com.cyz.common.enums;

/**
 * 枚举类，定义项目中需要的常量
 */
public enum MyEnums {

    //请求成功
    SUCCESS(200,"成功"),
    SUCCESS_LOGOUT(200,"退出成功"),
    ERROR(400, "失败"),
    SYSTEM_ERROR(401,"系统出现异常"),
    VALIDATION(402,"表单验证失败" ),
    ADD_FAIL(403,"添加数据失败" ),
    DELETE_FAIL(404,"删除数据失败" ),
    QUERY_FAIL(405,"查询数据失败" ),
    UPDATE_FAIL(406,"更新数据失败" ),
    FILE_TYPE_ERROR(407, "图片类型不符合规定"),
    FILE_UPLOAD_FAIL(408,  "上传图片失败"),
    DATABASE_FAIL(409,  "数据重复"),
    PARAMETER_LACK(410,  "数据提供不足"), 
    LOGIN_ERROR(411,"登录失败"),
    NEED_LOGIN(412,"需要登录"),
    LOGIN_FAIL(413, "未检测到您登录信息，请重新登录"),
    OLD_PASSWORD_ERROR(414,"密码验证失败"),
    NEW_PASSWORD_ERROR(415,"两次密码不一致"),
    LOGIN_BAN(416, "您的账号已经被停用，请联系管理员");

    //课程已发布
    public static final String CARD_RELEASE = "0";
    //课程未发布
    public static final String CARD_NOT_RELEASE = "1";
    //免费课程广告类型
    public static final String FREE_AD_TYPE = "0";
    //付费课程广告类型
    public static final String MONEY_AD_TYPE = "1";
    //课程下面的评论
    public static final String COMMENT_TYPE_CARD = "0";
    //评论区下面的评论
    public static final String COMMENT_TYPE_HELP = "1";
    //根评论
    public static final Integer COMMENT_ROOD_ID = -1;
    //redis存储管理员前缀
    public static final String ADMIN_REDIS_NAME = "adminLogin:";
    //redis存储用户前缀
    public static final String USER_REDIS_NAME = "userLogin:";
    //管理员类型
    public static final String USER_TYPE_ADMIN = "1";
    public static final String USER_TYPE_USER = "0";

    //管理员id
    public static final Integer ADMIN_ID = 1;
    //菜单类型
    public static final String MENU = "C";
    //菜单类型
    public static final String BUTTON = "F";
    //菜单类型
    public static final String DIRECTORY = "M";
    //正常使用
    public static final String NORMAL_STATUS = "0";
    //菜单根目录标志
    public static final Integer MENU_ROOT = 0;
    //账号被禁用
    public static final String USER_BAN = "1";
    //广告权限
    public static final String AD_PERMS = "contant:free:ad";

    //返回码
    private final Integer code;
    //返回信息
    private final String msg;

    MyEnums(Integer code, String msg){
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

}
